from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from items.gamble import Gamble
from items.ebay import Ebay


class Bedroom(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        self.add_item(Gamble())
        self.add_item(Ebay())
        
        # build list of actions
        self.add_action(Suit)
        self.add_action(Begin)
    
    # return description of room.
    def get_description(self):
        return '''
        You can't mow lawns because you have allergies and the lawn mower is too loud.  \n  
        How should you make some quick cash? \n
        '''
    # return image of room
    def get_image(self):
        return 'lawnmower.jpg'
         

class BedroomHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Bedroom

# define actions for this room


    
class Suit(Action):
    def __init__(self):
        Action.__init__(self, "Get a suit")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the suit shop"
    
    # set cutscene for when arrive in entrance_hall
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'suitarea'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class Begin(Action):
    def __init__(self):
        Action.__init__(self, "Beginning")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go back"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'beginning'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"